import request from "@/utils/request.js";

// 获取分页用户列表
export function requestUserListByPage(page, limit) {
  return request.get(`/admin/acl/user/${page}/${limit}`);
}

// 添加用户
export function requestSaveUserdata(data) {
  return request.post(`/admin/acl/user/save`, data);
}

// 修改用户
export function requestUpdateUserdata(data) {
  return request.put(`/admin/acl/user/update`, data);
}

// 删除指定用户
export function requestDeleteUserdata(id) {
  return request.delete(`/admin/acl/user/remove/${id}`);
}

// 批量删除
export function requestAllDeleteUserdata(idList) {
  return request.post(`/admin/acl/user/batchRemove`, idList);
}

// 查询用户
export function requestQueryUserdata(id) {
  return request.get(`/admin/acl/user/get/${id}`);
}

// 获取用户角色数据
export function requestGetRole(userId) {
  return request.get(`/admin/acl/user/toAssign/${userId}`);
}

// 根据用户分配角色
export function resquestAllocationRole(userId, roleId) {
  return request.post(
    `/admin/acl/user/doAssign?userId=${userId}&roleId=${roleId}`
  );
}
